﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class cart_pay : OTS.MemberPage
{
    private OTS.Model.custom custom;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.TestLogin(HttpContext.Current))
        {
            OTS.Common.Jscript.AlertAndRedirect("你还没有登陆！", "login.aspx");
            return;
        }
        custom = this.GetCustom(HttpContext.Current);
        if (!Page.IsPostBack)
        {
            PageBind();
        }
    }
    private void PageBind()
    {
        string strOrderNO = Request.QueryString["orderNO"];
        string strOrderID = Request.QueryString["orderId"];
        if (strOrderNO == null || strOrderNO == "" || strOrderID == null || strOrderID=="")
        {
            OTS.Common.Jscript.AlertAndRedirect("参数错误", "member-orders.aspx");
            return;
        }
        if(!OTS.Common.Help.IsNumber(strOrderID))
        {
            OTS.Common.Jscript.AlertAndRedirect("参数错误", "member-orders.aspx");
            return;
        }
        OTS.BLL.SaleOrderBLL bll = new OTS.BLL.SaleOrderBLL();
        OTS.Model.saleOrder model = bll.GetSimpleModelByNO(strOrderNO, custom.cusID);
        if (model == null )
        {
            OTS.Common.Jscript.AlertAndRedirect("参数错误", "member-orders.aspx");
            return;
        }
        if (model.orderID != int.Parse(strOrderID))
        {
            OTS.Common.Jscript.AlertAndRedirect("参数错误", "member-orders.aspx");
            return;
        }
        this.lblMoney.Text = model.totalMoney.ToString() + ".00 ";
        this.lblOrderNO.Text = model.orderNO.ToString();
        this.orderNO.Text = strOrderNO;
        this.orderId.Text = strOrderID;


    }

}
